package org.doubango.FrCall.Screens;

import org.doubango.FrCall.Engine;
import org.doubango.FrCall.R;
import org.doubango.FrCall.Services.IScreenService;
import org.doubango.FrCall.Utils.ControlButton;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ScreenManageFriendSelect extends BaseScreen {
	
	private static String TAG = ScreenChatSip.class.getCanonicalName();
	private final IScreenService mScreenService;
	
	private Button backToFriendViewFromManageFriendSelectView;
	private Button toManageFriendPage;
	private Button toManageGroupPage;
	
	public ScreenManageFriendSelect() {
		super(SCREEN_TYPE.MANAGE_FRIEND_SELECT, TAG);
		mScreenService = ((Engine)Engine.getInstance()).getScreenService();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen_manage_friend_select);
		backToFriendViewFromManageFriendSelectView = (Button) findViewById(R.id.back_to_friend_view_from_manage_friend_select_view);
		toManageFriendPage = (Button) findViewById(R.id.to_manage_friend_page);
		toManageGroupPage = (Button) findViewById(R.id.to_manage_group_page);
		
		ManageFriendSelectButtonListener manageFriendSelectButtonListener = new ManageFriendSelectButtonListener();
		backToFriendViewFromManageFriendSelectView.setOnClickListener(manageFriendSelectButtonListener);
		toManageFriendPage.setOnClickListener(manageFriendSelectButtonListener);
		toManageGroupPage.setOnClickListener(manageFriendSelectButtonListener);
	}
	private class ManageFriendSelectButtonListener implements OnClickListener{
		@Override
		public void onClick(View v) {
			if(v == backToFriendViewFromManageFriendSelectView){
				ControlButton.showButton();
				mScreenService.show(ScreenFriendList.class);
			}else if(v == toManageFriendPage){
				mScreenService.show(ScreenManageFriend.class);
			}else if(v == toManageGroupPage){
				mScreenService.show(ScreenManageGroup.class);
			}
		}
		
	}
	

}
